package com.baijiayun.liveuibase.skin;

import android.graphics.Color;
import android.view.View;

import java.util.HashMap;


public class BackgroundAttr extends SkinAttr {

	@Override
	public void apply(View view, HashMap<Integer, Integer> themeConfig) {
	    Integer color = themeConfig.get(attrValueRefId);
	    if (color == null || view == null) {
	        return;
        }
		if(RES_TYPE_NAME_COLOR.equals(attrName)){
		    view.setBackgroundColor(Color.GREEN);
		}else if(RES_TYPE_NAME_DRAWABLE.equals(attrName)){
            view.setBackgroundColor(Color.BLACK);
		} else if(RES_TYPE_NAME_BACKGROUND.equals(attrName)){
			view.setBackgroundColor(color);
		} else {
		    view.setBackgroundColor(Color.BLUE);
        }
	}
}
